export default {
  namespaced: true,
  state: {
    username: null,
    userId: null,
    token: null
  },
  getters: {
  },
  mutations: {
    loginMutation(state, user) {
      state.username = user.username;
      state.userId = user.userId;
      state.token = user.token
    }
  },
  actions: {
    loginAction({ commit }, user) {
      return new Promise((resolve) => {
        setTimeout(() => {
          commit('loginMutation', user);

          resolve();
        });
      })
    }
  },
}